<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<div class="modal-dialog x-modal-dialog" style="width:600px; margin-top: 150px;">

  <div class="modal-content" style="width: 700px;">

    <div class="modal-header x-breadcrumb clearfix">

      <h2><i class="glyphicon glyphicon-fire" title=""></i>&nbsp;&nbsp;<span>添加门店</span></h2>

      <button type="button" class="close" data-dismiss="modal">&times;</button>

    </div>

    <form class="form-horizontal" method="POST" action="${ctx.host}/sites?" data-validate="true">
      <div class="x-breadcrumb-wrapper" style="margin-top:20px;">
        <div class="x-breadcrumb yellow clearfix">
          <h2>
            <span>门店基本信息</span>
          </h2>
        </div>
      </div>
      
      <div class="form-horizontal" style="margin-bottom:20px;margin-left: 10px;margin-right: 10px;">
        <div class="form-group">
          <label class="col-xs-2 control-label">门店名称：</label>
          <div class="col-xs-4 pull-left">
            <input type="text" name="name" class="form-control" data-validate="required">
          </div>
          
          <label class="col-xs-2 control-label">门店别名：</label>
          <div class="col-xs-4 pull-left">
            <input type="text" name="alias" class="form-control" data-validate="required">
          </div>
        </div>
        
        <div class="form-group">
          <label class="col-xs-2 control-label">门店编号：</label>
          <div class="col-xs-4 pull-left">
            <input type="text" name="code" placeholder="例：001" class="form-control" data-validate="required">
          </div>
        </div>
        
        <div class="form-group">
          <label class="col-xs-2 control-label">市：</label>
          <div class="col-xs-4 pull-left">
            <input type="text" name="city" placeholder="例：上海，不要填上海市" class="form-control" data-validate="required">
          </div>
          
          <label class="col-xs-2 control-label">区：</label>
          <div class="col-xs-4 pull-left">
            <input type="text" name="district" placeholder="例：黄浦区" class="form-control" data-validate="required">
          </div>
        </div>
        
        <div class="form-group">
          <label class="col-xs-2 control-label">详细地址：</label>
          <div class="col-xs-10 pull-left">
            <input type="text" name="location.address" class="form-control" data-validate="required">
          </div>
        </div>
        
        <div class="form-group">
          <label class="col-xs-2 control-label">地址描述：</label>
          <div class="col-xs-10 pull-left">
            <input type="text" name="location.addressDescription" placeholder="例：地铁10号线江湾体育场7号口出站步行150米" class="form-control">
          </div>
        </div>
      </div>
      
      <div class="x-breadcrumb-wrapper" style="margin-top:20px;">
        <div class="x-breadcrumb yellow clearfix">
          <h2>
            <span>店长信息</span>
          </h2>
        </div>
      </div>
      
      <div class="form-horizontal" style="margin-bottom:20px;margin-left: 10px;margin-right: 10px;">
        <div class="form-group">
          <label class="col-xs-2 control-label">店长账号：</label>
          <div class="col-xs-4 pull-left">
            <input type="text" name="managerName" class="form-control" data-validate="required">
          </div>
          
          <label class="col-xs-2 control-label">店长手机号：</label>
          <div class="col-xs-4 pull-left">
            <input type="text" name="managerMobile" class="form-control" data-validate="required|mobile">
          </div>
        </div>
      </div>
      
      <div class="modal-footer clearfix">
        <button type="submit" class="btn btn-success btn-shadow btn-shadow-success x-btn">确定</button>&nbsp;&nbsp;&nbsp;&nbsp;
        <button type="button" class="btn btn-default btn-shadow btn-shadow-default x-btn" data-dismiss="modal">取消</button>
      </div>
    </form>

  </div>

</div>

<script>
  $(function() {
    
    $('select[name="managerId"]').select2({
        placeholder : '请选择店长',
        minimumResultsForSearch : -1,
        allowClear : true
    });
    
  })
</script>